import request from '@/utils/request'

// 查询活动列表
export function listAct(query) {
  return request({
    url: '/encounter/act/list',
    method: 'get',
    params: query
  })
}

// 查询活动详细
export function getAct(id) {
  return request({
    url: '/encounter/act/' + id,
    method: 'get'
  })
}

// 新增活动
export function addAct(data) {
  return request({
    url: '/encounter/act',
    method: 'post',
    data: data
  })
}

// 修改活动
export function updateAct(data) {
  return request({
    url: '/encounter/act',
    method: 'put',
    data: data
  })
}

// 删除活动
export function delAct(id) {
  return request({
    url: '/encounter/act/' + id,
    method: 'delete'
  })
}

// 活动审核
export function auditAct(id, data) {
  return request({
    url: '/encounter/act/audit/' + id,
    method: 'put',
    data: data
  })
}

// 活动手动隐藏
export function hideAct(id, status) {
  return request({
    // url: '/encounter/act/hide/' + id,
    url: `/encounter/act/hide/${id}/${status}`,
    method: 'put',
  })
}

// 活动置顶
export function topAct(id) {
  return request({
    url: '/encounter/act/top/' + id,
    method: 'put',
  })
}
